<li class="nav-item mr-2">
  <a class="nav-link" tabindex="0" data-trigger="click" id="languageSwitcher" data-toggle="popover"
    data-placement="bottom" data-target="#languagesPopoverBody" data-html="true">
    <i class="fas fa-fw fa-language" ></i>
  </a>
</li>
<script type="text/html" id="languagesPopoverBody">
  <ul class="languages list-group">
    {{- range $.Site.Home.AllTranslations -}}
    {{- $active := eq $.Lang .Language.Lang -}}
    <li class="language list-group-item{{ if $active }} active{{ end }}">
      {{- if not $active }}
      <a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
      {{- else -}}
      {{ .Language.LanguageName }}
      {{- end -}}
    </li>
    {{- end -}}
  </ul>
</script>
